<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class RelationNoteEntityRelationTable extends AbstractMigration
{
    public function up()
    {
        $table = $this->table('relation_note_entity_relation', ['id' => false, 'primary_key' => ['id'], 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '关联需求关联关系表']);
        $table->addColumn('id', 'integer', ['identity' => true, 'signed' => false, 'limit' => 11, 'comment' => '主键ID'])
            ->addColumn('entity_id', 'integer', ['limit' => 11, 'default' => 0, 'null' => false, 'comment' => '实体id'])
            ->addColumn('note_entity_relation_id', 'integer', ['limit' => 11, 'default' => 0, 'null' => false, 'comment' => '需求关联id'])
            ->addColumn('created', 'integer', ['limit' => 11, 'default' => 0, 'null' => false, 'comment' => '创建时间'])
            ->save();
    }

    public function down()
    {
        $this->table('relation_note_entity_relation')->drop()->save();
    }
}
